package com.wanmait.schedule.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.wanmait.schedule.entity.Schedule;
import com.wanmait.schedule.mapper.ScheduleMapper;
import com.wanmait.schedule.service.ScheduleService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 日程表（备忘录表） 服务实现类
 * </p>
 *
 * @author wanmait
 * @since 2022-03-02
 */
@Service
public class ScheduleServiceImpl extends ServiceImpl<ScheduleMapper, Schedule> implements ScheduleService {

    //通过用户id查询所有日程
    @Override
    public List<Schedule> findAll(Integer userinfoId) {
        LambdaQueryWrapper<Schedule> lambdaQueryWrapper=new LambdaQueryWrapper<>();
        lambdaQueryWrapper.eq(Schedule::getUserinfoId,userinfoId);
        List<Schedule> schedules=this.list(lambdaQueryWrapper);
        return schedules;
    }

}
